home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 February / EnigmA AMIGA RUN 04 (1996)(G.R. Edizioni)(IT)[!][issue 1996-02][Skylink CD III].iso / earcd / comm2 / termsorc.lha / Extras / Source / term-source.lha / termARexxGlobal.h < prev    next >
C/C++ Source or Header  |  1995-09-26  |  7KB  |  226 lines

  1. /*
  2. **    termARexxGlobal.h
  3. **
  4. **    Global data definitions for ARexx interface
  5. **
  6. **    Copyright © 1990-1995 by Olaf `Olsen' Barthel
  7. **        All Rights Reserved
  8. */
  9.  
  10. #include "termGlobal.h"
  11.  
  12.     /* Information table entry types. */
  13.  
  14. enum    {    INFO_STEM,INFO_TEXT,INFO_NUMERIC,INFO_BOOLEAN,INFO_MAPPED };
  15.  
  16.     /* Data types to save or open. */
  17.  
  18. enum    {    DATATYPE_TRANSLATIONS,DATATYPE_FUNCTIONKEYS,DATATYPE_CURSORKEYS,
  19.         DATATYPE_FASTMACROS,DATATYPE_HOTKEYS,DATATYPE_SPEECH,DATATYPE_SOUND,DATATYPE_BUFFER,
  20.         DATATYPE_CONFIGURATION,DATATYPE_PHONEBOOK,DATATYPE_SCREENTEXT,
  21.         DATATYPE_SCREENIMAGE,DATATYPE_COUNT };
  22.  
  23.     /* Requester types. */
  24.  
  25. enum    {    REQUESTER_SERIAL,REQUESTER_MODEM,REQUESTER_SCREEN,
  26.         REQUESTER_TERMINAL,REQUESTER_EMULATION,REQUESTER_CLIPBOARD,
  27.         REQUESTER_CAPTURE,REQUESTER_COMMANDS,REQUESTER_MISC,
  28.         REQUESTER_PATH,REQUESTER_TRANSFER,REQUESTER_TRANSLATIONS,
  29.         REQUESTER_FUNCTIONKEYS,REQUESTER_CURSORKEYS,REQUESTER_FASTMACROS,
  30.         REQUESTER_HOTKEYS,REQUESTER_SPEECH,REQUESTER_SOUND,REQUESTER_PHONE,
  31.         REQUESTER_COUNT };
  32.  
  33.     /* Window types. */
  34.  
  35. enum    {    WINDOWID_BUFFER,WINDOWID_REVIEW,WINDOWID_PACKET,WINDOWID_FASTMACROS,
  36.         WINDOWID_STATUS,WINDOWID_MAIN,WINDOWID_UPLOAD_QUEUE,WINDOWID_SINGLE_CHAR_ENTRY,
  37.         WINDOWID_COUNT
  38.     };
  39.  
  40.     /* The maximum length of an ARexx result variable. */
  41.  
  42. #define MAX_RESULT_LEN    65536
  43.  
  44.     /* ARexx interface error codes. */
  45.  
  46. #define TERMERROR_NO_DATA_TO_PROCESS            1000
  47. #define TERMERROR_INDEX_OUT_OF_RANGE            1001
  48. #define TERMERROR_UNKNOWN_OBJECT            1002
  49. #define TERMERROR_RESULT_VARIABLE_REQUIRED        1003
  50. #define TERMERROR_UNIT_NOT_AVAILABLE            1004
  51. #define TERMERROR_DEVICE_DRIVER_STILL_OPEN        1005
  52. #define TERMERROR_CLIPBOARD_ERROR            1006
  53. #define TERMERROR_INFORMATION_IS_READ_ONLY        1007
  54. #define TERMERROR_DATA_TYPES_INCOMPATIBLE        1008
  55. #define TERMERROR_LIST_IS_ALREADY_EMPTY            1009
  56. #define TERMERROR_UNKNOWN_LIST                1010
  57. #define TERMERROR_WRONG_LIST                1011
  58. #define TERMERROR_UNKNOWN_COMMAND            1012
  59.  
  60.     /* An information table entry node. */
  61.  
  62. struct AttributeEntry
  63. {
  64.     WORD     Level;        /* Node level */
  65.     STRPTR     Name;        /* Name or NULL for numeric value */
  66.     UBYTE     Type;        /* Node type (INFO_TEXT through INFO_MAPPED) */
  67.     BYTE     ReadOnly;    /* If information happens to be read-only */
  68.     STRPTR    *Mappings;    /* Type mappings if applicable */
  69.     WORD     NodeID;    /* Node ID code */
  70. };
  71.  
  72.     /* Argument mutual exclusion information. */
  73.  
  74. struct ExclusionInfo
  75. {
  76.     BYTE    A,B;
  77. };
  78.  
  79.     /* A special message and argument packet. */
  80.  
  81. struct RexxPkt
  82. {
  83.     struct Message         VanillaMessage;
  84.  
  85.     struct RexxMsg        *RexxMsg;
  86.     STRPTR            *Array;
  87.     struct RDArgs        *Args;
  88.     struct CommandInfo    *CommandInfo;
  89.     LONG             Results[2];
  90. };
  91.  
  92.     /* A special function key pointer. */
  93.  
  94. typedef STRPTR (*  COMMAND)(struct RexxPkt *);
  95.  
  96.     /* Argument inclusion bits. */
  97.  
  98. #define INCLUDE_00 (1 <<  0)
  99. #define INCLUDE_01 (1 <<  1)
  100. #define INCLUDE_02 (1 <<  2)
  101. #define INCLUDE_03 (1 <<  3)
  102. #define INCLUDE_04 (1 <<  4)
  103. #define INCLUDE_05 (1 <<  5)
  104. #define INCLUDE_06 (1 <<  6)
  105. #define INCLUDE_07 (1 <<  7)
  106. #define INCLUDE_08 (1 <<  8)
  107. #define INCLUDE_09 (1 <<  9)
  108. #define INCLUDE_10 (1 << 10)
  109. #define INCLUDE_11 (1 << 11)
  110.  
  111.     /* Rexx command information. */
  112.  
  113. struct CommandInfo
  114. {
  115.     WORD    Async;
  116.     BYTE    Tool;
  117.     BYTE    Console;
  118.     COMMAND    Routine;
  119.     STRPTR    Name,
  120.         Arguments;
  121. };
  122.  
  123.     /* termARexx.c */
  124.  
  125. BYTE __regargs            IsNumeric(STRPTR String);
  126. STRPTR __regargs        CreateResult(STRPTR ResultString,LONG *Results);
  127. STRPTR __regargs        CreateResultLen(STRPTR ResultString,LONG *Results,LONG Len);
  128. BYTE __stdargs            CreateVarArgs(STRPTR Value,struct RexxPkt *Packet,STRPTR Stem,...);
  129. STRPTR __regargs        CreateVar(STRPTR Value,struct RexxPkt *Packet,STRPTR Name);
  130. STRPTR __regargs        CreateMatchBuffer(STRPTR Pattern);
  131. BYTE __regargs            MatchBuffer(STRPTR Buffer,STRPTR Name);
  132. VOID __regargs            DeleteMatchBuffer(STRPTR Buffer);
  133. WORD __regargs            ToMode(STRPTR Name);
  134. WORD __regargs            ToList(STRPTR Name);
  135. WORD __regargs            ToConfig(STRPTR Name);
  136. WORD __regargs            ToRequester(STRPTR Name);
  137. WORD __regargs            ToWindow(STRPTR Name);
  138. VOID __regargs            RexxPktCleanup(struct RexxPkt *Packet,STRPTR Result);
  139. VOID __saveds            RexxServer(VOID);
  140. BYTE                HandleRexx(VOID);
  141.  
  142.     /* termARexxAttributes.c */
  143.  
  144. STRPTR                RexxGetAttr(struct RexxPkt *Pkt);
  145. STRPTR                RexxSetAttr(struct RexxPkt *Pkt);
  146.  
  147.     /* termARexxCommands.c */
  148.  
  149. STRPTR                RexxActivate(struct RexxPkt *Pkt);
  150. STRPTR                RexxAdd(struct RexxPkt *Pkt);
  151. STRPTR                RexxBaud(struct RexxPkt *Pkt);
  152. STRPTR                RexxBeepScreen(struct RexxPkt *Pkt);
  153. STRPTR                RexxCallMenu(struct RexxPkt *Pkt);
  154. STRPTR                RexxCapture(struct RexxPkt *Pkt);
  155. STRPTR                RexxClear(struct RexxPkt *Pkt);
  156. STRPTR                RexxClearScreen(struct RexxPkt *Pkt);
  157. STRPTR                RexxClose(struct RexxPkt *Pkt);
  158. STRPTR                RexxCloseDevice(struct RexxPkt *Pkt);
  159. STRPTR                RexxCloseRequester(struct RexxPkt *Pkt);
  160. STRPTR                RexxDeactivate(struct RexxPkt *Pkt);
  161. STRPTR                RexxDial(struct RexxPkt *Pkt);
  162. STRPTR                RexxDelay(struct RexxPkt *Pkt);
  163. STRPTR                RexxDuplex(struct RexxPkt *Pkt);
  164. STRPTR                RexxFault(struct RexxPkt *Pkt);
  165. STRPTR                RexxGetClip(struct RexxPkt *Pkt);
  166. STRPTR                RexxGoOnline(struct RexxPkt *Pkt);
  167. STRPTR                RexxHangup(struct RexxPkt *Pkt);
  168. STRPTR                RexxHelp(struct RexxPkt *Pkt);
  169. STRPTR                RexxOpen(struct RexxPkt *Pkt);
  170. STRPTR                RexxOpenDevice(struct RexxPkt *Pkt);
  171. STRPTR                RexxOpenRequester(struct RexxPkt *Pkt);
  172. STRPTR                RexxParity(struct RexxPkt *Pkt);
  173. STRPTR                RexxPasteClip(struct RexxPkt *Pkt);
  174. STRPTR                RexxPrint(struct RexxPkt *Pkt);
  175. STRPTR                RexxProcessIO(struct RexxPkt *Pkt);
  176. STRPTR                RexxProtocol(struct RexxPkt *Pkt);
  177. STRPTR                RexxPutClip(struct RexxPkt *Pkt);
  178. STRPTR                RexxQuit(struct RexxPkt *Pkt);
  179. STRPTR                RexxRead(struct RexxPkt *Pkt);
  180. STRPTR                RexxReceiveFile(struct RexxPkt *Pkt);
  181. STRPTR                RexxRedial(struct RexxPkt *Pkt);
  182. STRPTR                RexxRemove(struct RexxPkt *Pkt);
  183. STRPTR                RexxRequestFile(struct RexxPkt *Pkt);
  184. STRPTR                RexxRequestNotify(struct RexxPkt *Pkt);
  185. STRPTR                RexxRequestNumber(struct RexxPkt *Pkt);
  186. STRPTR                RexxRequestResponse(struct RexxPkt *Pkt);
  187. STRPTR                RexxRequestString(struct RexxPkt *Pkt);
  188. STRPTR                RexxResetScreen(struct RexxPkt *Pkt);
  189. STRPTR                RexxResetStyles(struct RexxPkt *Pkt);
  190. STRPTR                RexxResetText(struct RexxPkt *Pkt);
  191. STRPTR                RexxResetTimer(struct RexxPkt *Pkt);
  192. STRPTR                RexxSaveAs(struct RexxPkt *Pkt);
  193. STRPTR                RexxSave(struct RexxPkt *Pkt);
  194. STRPTR                RexxSelect(struct RexxPkt *Pkt);
  195. STRPTR                RexxSend(struct RexxPkt *Pkt);
  196. STRPTR                RexxSendBreak(struct RexxPkt *Pkt);
  197. STRPTR                RexxSendFile(struct RexxPkt *Pkt);
  198. STRPTR                RexxSpeak(struct RexxPkt *Pkt);
  199. STRPTR                RexxStopBits(struct RexxPkt *Pkt);
  200. STRPTR                RexxTextBuffer(struct RexxPkt *Pkt);
  201. STRPTR                RexxTimeout(struct RexxPkt *Pkt);
  202. STRPTR                RexxTrap(struct RexxPkt *Pkt);
  203. STRPTR                RexxWait(struct RexxPkt *Pkt);
  204. STRPTR                RexxWindow(struct RexxPkt *Pkt);
  205. STRPTR                RexxRX(struct RexxPkt *Pkt);
  206. STRPTR                RexxExecTool(struct RexxPkt *Pkt);
  207.  
  208.     /* termARexxData.c */
  209.  
  210. extern struct AttributeEntry __far     AttributeTable[];
  211. extern LONG                 AttributeTableSize;
  212.  
  213. extern UWORD                 InclusionTable[];
  214. extern struct ExclusionInfo        *ExclusionTable[];
  215.  
  216. extern struct CommandInfo __far         CommandTable[];
  217. extern LONG                 CommandTableSize;
  218.  
  219. extern struct MsgPort            *RexxPort;
  220. extern LONG                 LastRexxError;
  221. extern LONG                 RexxTimeoutVal;
  222. extern BYTE                 UpdateRequired,
  223.                      TransferUpdateRequired;
  224. extern LONG                 RexxLaunchCount;
  225. extern struct SignalSemaphore         RexxLaunchSemaphore;
  226.